<?php

namespace common\models\business;

use Yii;
use yii\db\Query;

/**
 * This is the model class for table "business_exception".
 *
 * @property string $id
 * @property integer $pigid
 * @property string $person
 * @property string $reason
 * @property string $descripation
 * @property integer $createtime
 */
class BusinessException extends \yii\db\ActiveRecord
{


    //主要用于日志记录
    public $uselog = [
        'tabcomment' => '异常',      //用于修改了什么的显示
        'mainfield' => 'id',      //主要的显示标题的字段
        'picturefield' => [],        //图片字段
        'timefield' => [],       //时间字段
        'unsetfiled' =>[],      //不需要记录的字段
    ];


    //死亡标志话语
    const EXCEPTION_DIE = '仔猪死亡';




    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'business_exception';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['pigid', 'person', 'reason', 'descripation', 'createtime'], 'required'],
            [['pigid', 'createtime'], 'integer'],
            [['person', 'reason', 'descripation'], 'string', 'max' => 255],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'pigid' => '仔猪',
            'person' => '业务员',
            'reason' => '原因',
            'descripation' => '描述',
            'createtime' => '创建时间',
        ];
    }


}
